// focus on the clicked on menu item.
grab: function(params) {
params = Params.parse(params, { actor: null,
- modal: false,
focus: null,
onUngrab: null });
params.savedFocus = focus;
- if (params.modal && !this._takeModalGrab())
+ if (!this._takeModalGrab())
return false;
this._grabStack.push(params);
newFocus.grab_key_focus();
}
- if (params.modal && !this._capturedEventId)
- this._capturedEventId = global.stage.connect('captured-event', Lang.bind(this, this._onCapturedEvent));
-
return true;
},
if (firstGrab) {
if (!Main.pushModal(this._owner, this._modalParams))
return false;
+
+ this._capturedEventId = global.stage.connect('captured-event', Lang.bind(this, this._onCapturedEvent));
}
this._modalCount++;
if (this._modalCount > 0)
return;
+ global.stage.disconnect(this._capturedEventId);
+ this._capturedEventId = 0;
+
+ this._ignoreRelease = false;
+
Main.popModal(this._owner);
global.sync_pointer();
},
if (poppedGrab.onUngrab)
poppedGrab.onUngrab(params.isUser);
- if (poppedGrab.modal)
- this._releaseModalGrab();
- }
-
- if (!this.grabbed && this._capturedEventId > 0) {
- global.stage.disconnect(this._capturedEventId);
- this._capturedEventId = 0;
-
- this._ignoreRelease = false;
+ this._releaseModalGrab();
}
if (hadFocus) {
let [x, y, mask] = global.get_pointer();
this._contextMenu.setPosition(Math.round(x), Math.round(y));
this._grabHelper.grab({ actor: this._contextMenu.actor,
- modal: true,
onUngrab: Lang.bind(this, function () {
this._contextMenu.close(BoxPointer.PopupAnimation.FULL);
})
_showTray: function() {
if (!this._grabHelper.grab({ actor: this.actor,
- modal: true,
onUngrab: Lang.bind(this, this._escapeTray) })) {
this._traySummoned = false;
return false;
this._summaryBoxPointer.bin.child = child;
this._grabHelper.grab({ actor: this._summaryBoxPointer.bin.child,
- modal: true,
onUngrab: Lang.bind(this, this._onSummaryBoxPointerUngrabbed) });
this._summaryBoxPointer.actor.opacity = 0;
if (open) {
if (this.activeMenu && !this.activeMenu.isChildMenu(menu))
this.activeMenu.close(BoxPointer.PopupAnimation.FADE);
- this._grabHelper.grab({ actor: menu.actor, modal: true, focus: menu.sourceActor,
+ this._grabHelper.grab({ actor: menu.actor, focus: menu.sourceActor,
onUngrab: Lang.bind(this, this._closeMenu, menu) });
} else {
this._grabHelper.ungrab({ actor: menu.actor });